﻿using System.Collections.Generic;
using Engine;
using Engine.Graphics;

namespace Game
{
    public class 竹子块 : CubeBlock
    {
        public const int Index = 308;
        public Texture2D m_texture;
        public override void Initialize()
        {

            InHandScale = (float)0.35;
            FirstPersonScale = (float)0.4;
            FirstPersonOffset = new Vector3((float)0.5, (float)-0.5, (float)-0.5);
            base.Initialize();
            this.m_texture = ContentManager.Get<Texture2D>("Textures/Blocks", null);
        }
        public override void GenerateTerrainVertices(BlockGeometryGenerator generator, TerrainGeometry geometry, int value, int x, int y, int z)
        {
            generator.GenerateCubeVertices(this, value, x, y, z, Color.White, geometry.GetGeometry(this.m_texture).OpaqueSubsetsByFace);
        }
        public override void DrawBlock(PrimitivesRenderer3D primitivesRenderer, int value, Color color, float size, ref Matrix matrix, DrawBlockEnvironmentData environmentData)
        {
            BlocksManager.DrawCubeBlock(primitivesRenderer, value, new Vector3(size), ref matrix, color, color, environmentData, this.m_texture);
        }
        public override int GetTextureSlotCount(int value)
        {
            return 1;
        }
    }
}
